home *** CD-ROM | disk | FTP | other *** search
- -- background: 5410 from stack: in
- -- bmap block id: 3915
- -- flags: 4000
- -- background id: 0
- -- name: Plot.back
- ----- HyperTalk script -----
- --
- -- uses XCMDs drawgram, hp2pict, getPutfilename
- --
- -- drawgram, drawtree XCMD calls
- --
- -- drawgram tree, [parameters,] [output fld]
- -- the result contains the HP plot
- --
- -- hp2pict XCMD calls
- --
- -- hp2pict "open",name, [plotrect] ; returns window pointer
- -- open blank window
- -- hp2pict "drawc",window pointer, HPcontainer
- -- draw HP container to window
- -- hp2pict "file",window pointer,filename, [file creator]
- -- save window pict as file
- -- hp2pict "clip",window pointer
- -- put window pict into clipbd
- -- hp2pict "print",window pointer
- -- print window pict
- -- hp2pict "close",window pointer
- -- close window
- --
- -- XFCN GetPutFilename
- --
- -- get getPutFilename("TEXT") -- std get for TEXT files
- -- get getPutFilename() -- std get for any file
- -- get getPutFilename("Put","Prompt","Default name")
- -- std put for file, with optional prompt and default name
- --
-
- on closeBackground
- closeplot
- end closeBackground
-
- on newPlot
- global plotWindow, plotfiled
- set cursor to watch
- put the rect of bg button "plotsize" into plotsize
- hp2pict "OPEN", field "title", plotsize
- put the result into plotWindow
- put false into plotfiled
- show bg button "Close plot"
- show bg button "Clip plot"
- show bg button "File plot"
- show bg button "Print plot"
- show bg button "Edit plot"
- end newPlot
-
- on closeplot
- global plotWindow
- if (plotWindow is not empty) and (plotWindow is not 0) then
- hp2pict "CLOSE",plotWindow
- put empty into plotWindow
- end if
- hide bg button "Close plot"
- hide bg button "Clip plot"
- hide bg button "File plot"
- hide bg button "Print plot"
- hide bg button "Edit plot"
- end closeplot
-
- on CallDrawGram
- -- message sent from run card
- global plotWindow, treefile, parmfile, hp
- newplot
- drawgram treefile, parmfile, "output"
- put the result into hp
- if hp is empty then
- closeplot
- answer "Plot failed." with "Continue"
- else
- hp2pict "DRAWC", plotWindow, hp
- end if
- end CallDrawGram
-
- on CallDrawTree
- -- message sent from run card
- global plotWindow, treefile, parmfile, hp
- newplot
- drawtree treefile, parmfile, "output"
- put the result into hp
- if hp is empty then
- closeplot
- answer "Plot failed." with "Continue"
- else
- hp2pict "DRAWC", plotWindow, hp
- end if
- end CallDrawTree
-
- on CallPlotGram
- -- message sent from run card
- global plotWindow, treefile, parmfile, hp
- newplot
- plotgram treefile, parmfile, "output"
- put the result into hp
- if hp is empty then
- closeplot
- answer "Plot failed." with "Continue"
- else
- hp2pict "DRAWC", plotWindow, hp
- end if
- end CallPlotGram
-
- on CallPlotTree
- -- message sent from run card
- global plotWindow, treefile, parmfile, hp
- newplot
- ploTree treefile, parmfile, "output"
- put the result into hp
- if hp is empty then
- closeplot
- answer "Plot failed." with "Continue"
- else
- hp2pict "DRAWC", plotWindow, hp
- end if
- end CallPlotTree
-
- on clipPlot
- global plotWindow
- hp2pict "CLIP",plotWindow
- put rect of bg button "plotsize" into plotsize
- DoMenu "Paste Picture"
- -- auto selects paint tool
- put item 1 to 2 of plotsize into pt
- drag from 0,0 to pt
- choose browse tool
- show bg button "Save card"
- end clipPlot
-
- on printPlot
- global plotWindow
- hp2pict "PRINT", plotWindow
- end printPlot
-
- on filePlot
- -- some programs that can edit PICTures:
- -- "MDPL" is MacDraw II (default)
- -- "SPNT" is SuperPaint
- -- "MDRW" is original MacDraw
- -- ? is Canvas
- global plotWindow, filename, plotfiled
- put GetPutFilename("Put", "Save plot as:", field "title") into filename
- if filename Γëá empty then
- hp2pict "FILE", plotWindow, filename, "MDPL"
- put true into plotfiled
- end if
- end filePlot
-
- on editPlot
- global filename, plotfiled
- if plotfiled Γëá true then fileplot
- if plotfiled is true then
- open filename with "MacDraw II"
- --open filename with "Canvas 2.0"
- --open filename with "SuperPaint 2.0"
- end if
- end editPlot
-
- -- end plot.back
-
-
-
- -- part 6 (field)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=18 top=8 right=37 bottom=348
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 18
- -- style flags: 256
- -- line height: 24
- -- part name: title
-
-
- -- part 20 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=0 top=48 right=342 bottom=437
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: plotsize
-
-
- -- part 21 (field)
- -- low flags: 01
- -- high flags: 0007
- -- rect: left=10 top=60 right=274 bottom=430
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 9
- -- style flags: 0
- -- line height: 12
- -- part name: output
-
-
- -- part 24 (button)
- -- low flags: 80
- -- high flags: A004
- -- rect: left=441 top=85 right=110 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Close Plot
- ----- HyperTalk script -----
- on mouseUp
- closeplot
- end mouseUp
-
-
-
- -- part 25 (button)
- -- low flags: 80
- -- high flags: A004
- -- rect: left=451 top=112 right=135 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Clip Plot
- ----- HyperTalk script -----
- on mouseUp
- clipPlot
- end mouseUp
-
-
-
- -- part 26 (button)
- -- low flags: 80
- -- high flags: A004
- -- rect: left=453 top=139 right=189 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 1007 / 1007
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: print plot
- ----- HyperTalk script -----
- on mouseUp
- printPlot
- end mouseUp
-
-
-
- -- part 27 (button)
- -- low flags: 80
- -- high flags: A004
- -- rect: left=454 top=190 right=237 bottom=507
- -- title width / last selected line: 0
- -- icon id / first selected line: 5059 / 5059
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: file plot
- ----- HyperTalk script -----
- on mouseUp
- filePlot
- end mouseUp
-
-
-
- -- part 28 (button)
- -- low flags: 00
- -- high flags: A004
- -- rect: left=442 top=241 right=265 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Save card
- ----- HyperTalk script -----
- on mouseUp
- push card
- domenu "Copy card"
- domenu "Paste card"
- set name of this card to "Saved.plot"
- set cantdelete of this card to false
- pop card
- hide me
- end mouseUp
-
-
-
- -- part 29 (button)
- -- low flags: 00
- -- high flags: 2000
- -- rect: left=436 top=9 right=35 bottom=467
- -- title width / last selected line: 0
- -- icon id / first selected line: 9301 / 9301
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Prev
- ----- HyperTalk script -----
- on mouseUp
- visual effect wipe right
- go to previous card
- end mouseUp
-
-
-
-
- -- part 30 (button)
- -- low flags: 00
- -- high flags: 2000
- -- rect: left=465 top=9 right=35 bottom=493
- -- title width / last selected line: 0
- -- icon id / first selected line: 27009 / 27009
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Next
- ----- HyperTalk script -----
- on mouseUp
- visual effect wipe left
- go to next card
- end mouseUp
-
-
-
-
- -- part 31 (button)
- -- low flags: 80
- -- high flags: A004
- -- rect: left=442 top=274 right=297 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Edit Plot
- ----- HyperTalk script -----
- on mouseUp
- editplot
- end mouseUp
-
-
-
- -- part 32 (button)
- -- low flags: 00
- -- high flags: A003
- -- rect: left=406 top=325 right=342 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Hide menubar
- ----- HyperTalk script -----
- on mouseUp
- if name of me contains "Hide" then
- hide menubar
- set name of me to "Show menubar"
- else
- show menubar
- set name of me to "Hide menubar"
- end if
- end mouseUp
-
-